const express = require('express');
const router = express.Router();
const {
    getAllowanceByUserId,
    addAllowance,
    updateAllowance,
    deleteAllowance,
    getAllowanceById
} = require('../controller/AllowanceController');

// 获取用户的加班记录列表
router.get('/:userId', getAllowanceByUserId);

// 添加加班记录
router.post('/', addAllowance);

// 更新加班记录
router.put('/:id', updateAllowance);

// 删除加班记录
router.delete('/:id', deleteAllowance);

// 获取单条加班记录
router.get('/:id/:userId', getAllowanceById);

module.exports = router; 